import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      redirect: '/login',
      children: [
        { path: 'sys', component: () => import('../views/sys/SysView.vue'), name: 'index' },
        { path: 'read', component: () => import('../views/sys/ReadView.vue'), name: 'read' },
        { path: 'judge', component: () => import('../views/sys/ChatView.vue'), name: 'jduge' },
        { path: 'readpage', component: () => import('../views/sys/ReadPage.vue'), name: 'readPage' },
      ]
    },
    {
      path: '/video',
      name: 'video',
      component: () => import('../views/sys/WatchPage.vue')
    },
    {
      path: '/watch',
      name: 'watchVideo',
      component: () => import('../views/sys/VideoPage.vue')
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
  ]
})

export default router
